import Vue from 'vue';
import VueI18n from 'vue-i18n';
import locale from 'element-ui/lib/locale';
import messages from './lang';
Vue.use(VueI18n);
const i18n = new VueI18n({
  // 这里修改成你自己获取语言的方法，如从cookie，或者url，对应函数也做响应修改, 默认为en
  locale: localStorage.getItem('language') || 'zh',
  fallbackLocale: localStorage.getItem('language') || 'zh',
  silentFallbackWarn: true,
  silentTranslationWarn: process.env.NODE_ENV === 'production',
  messages: messages
});
locale.i18n((key, value) => i18n.t(key, value));
export default i18n;
